package com.gqzmy.springboot3.exceptions;

/**
 * @author 周小哥  gqzmy@163.com 2023/4/20 23:34
 */

public class ExceptionInfo {

    /**
     * 错误信息
     */
    private String errorMessage;

    /**
     * 错误码
     */
    private String errorCode;

    /**
     * 提示信息
     */
    private String userTip;

    /**
     * 堆栈
     */
    private String stackTrace;

    public String getErrorMessage() {
        return errorMessage;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public String getUserTip() {
        return userTip;
    }

    public String getStackTrace() {
        return stackTrace;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public void setUserTip(String userTip) {
        this.userTip = userTip;
    }

    public void setStackTrace(String stackTrace) {
        this.stackTrace = stackTrace;
    }

    public ExceptionInfo stackTrace(String stackTrace) {
        this.stackTrace = stackTrace;
        return this;
    }

    public ExceptionInfo errorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
        return this;
    }

    public ExceptionInfo errorCode(String errorCode) {
        this.errorCode = errorCode;
        return this;
    }

    public ExceptionInfo userTip(String userTip) {
        this.userTip = userTip;
        return this;
    }


    public static ExceptionInfo create() {
        return new ExceptionInfo();
    }

    public ExceptionInfo build() {
        return this;
    }

    @Override
    public String toString() {
        return "ExceptionInfo{" +
                "errorMessage='" + errorMessage + '\'' +
                ", errorCode='" + errorCode + '\'' +
                ", userTip='" + userTip + '\'' +
                ", stackTrace='" + stackTrace + '\'' +
                '}';
    }
}
